package com.calvin.study.multithread.cas;

import java.util.concurrent.atomic.AtomicInteger;

public class CasDemo {
	public static void main(String[] args) {
		AtomicInteger atomicInteger = new AtomicInteger(5);
		
		System.out.println(atomicInteger.compareAndSet(5, 2022) + "\t current:" + atomicInteger.get());
		System.out.println(atomicInteger.compareAndSet(5, 9527) + "\t current:" + atomicInteger.get());
	}

}
